1. Field of the Invention
This invention relates to transforming and manipulating program object code.
2. Description of Related Art
Most computer programs consist of source code, a set of instructions in a programming language which is relatively easy for human beings to read and understand. The source code is translated by a compiler into object code, a set of instructions suited for execution by a computer processor, and which is relatively difficult for human beings to read and understand. When developing or debugging a program, it is often desirable to be able to insert checkpoints or other extra functions into the program, so as to determine or verify the state of the program at known flow points.
One known method is to insert checkpoints into the source code and recompile the program, so as to generate object code which has the desired added functions. While this method achieves the purpose of adding known checkpoints at known flow points, it is subject to the drawback that recompilation of the source code can take substantial time and computing resources.
Another method is to insert checkpoints into the object code without recompiling the program. However, object code is strongly dependent on the platform (including machine architecture and operating system) for which the object code is designed. This has forced known methods to work using specific features of that platform when modifying the object code. This has the drawback that tools for inserting checkpoints into object code must be designed and built for specific platforms; this limits their utility and makes it difficult to port those tools to other platforms.
Accordingly, it would be advantageous to provide a method and system for manipulating object code which is generally applicable to object code designed for all platforms.
The following U.S. patent(s) and other documents may be pertinent:
U.S. Pat. No. 5,193,180, issued Mar. 9, 1993, in the name of Reed Hastings, titled "System for Modifying Relocatable Object Code Files to Monitor Accesses to Dynamically Allocated Memory"; PA1 U.S. Pat. No. 5,335,344, issued Aug. 2, 1994, in the name of Reed Hastings, titled "Method for Inserting New Machine Instructions Into Preexisting Machine Access to Memory"; PA1 Ball, Thomas, et al., "Optimally Profiling and Tracing Programs", University of Wisconsin Computer Sciences Technical Report 1031 (Sep. 6, 1991); PA1 Bartlett, Joel F., "Compacting Garbage Collection with Ambiguous Roots", WRL Research Report 88/2 (Digital Western Research Laboratory, 1988); PA1 Borg, Anita, et al., "Long Address Traces from RISC Machines: Generation and Analysis", WRL Research Report 89/14 (Digital Western Research Laboratory, September 1989); PA1 Curry, Timothy W., "Profiling and Tracing Dynamic Library Usage Via Interposition", USENIX Conference Summer 1994 (Jun. 6-10, 1994); PA1 Feustel, Edward A., "On The Advantages of Tagged Architecture", IEEE Transactions on Computers, vol. C-22, no. 7 (July 1973); PA1 Goldberg, Aaron, et al., "MTOOL: A Method For Detecting Memory Bottlenecks", WRL Technical Note TN-17 (Digital Western Research Laboratory, December 1990); PA1 Hastings, Reed, et al., "Purify: Fast Detection of Memory Leaks and Access Errors", USENIX Conference (Winter 1992); PA1 Huang, J., "Detection of Data Flow Anomaly Through Program Instrumentation", IEEE Transactions on Software Engineering, vol. SE-5, no. 3 (May 1979); PA1 Kaufer, Stephen, et al., "Saber-C: An Interpreter-based Programming Environment for the C Language", USENIX Conference (Summer 1988); PA1 Kempton, Willett, et al., "Run-time Detection of Undefined Variables Considered Essential", Software - - - Practice and Experience, vol. 20(4), 391-402 (April 1990); PA1 Kessler, Peter B., "Fast Breakpoints: Design and Implementation", Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation (White Plains, New York, Jun. 20-22, 1990); PA1 Larus, James R., et al., "Rewriting Executable Files to Measure Program Behavior", University of Wisconsin Computer Sciences Technical Report 1083 (March 25, 1992); PA1 Randall, "C Dynamic Memory Use", Dr. Dobb's Journal (August 1989); PA1 Sato, Mitsuhisa, et al., "Run-time Checking in Lisp by Integrating Memory Addressing and Range Checking"; PA1 Srivastava, Amitabh, et al., "A Practical System for Intermodule Code Optimization at Link-Time", WRL Research Report 92/6 (Digital Western Research Laboratory, December 1992); PA1 Steffen, Joseph L., "Adding Run-time Checking to the Portable C Compiler", Software - - - Practice and Experience, vol. 22(4), 205-316 (April 1992); PA1 Wall, David W., "Global Register Allocation at Link Time", WRL Research Report 86/3 (Digital Western Research Laboratory, Oct. 28, 1986); PA1 Wall, David W., "Global Register Allocation at Link Time", Proceedings of the SIGPLAN '86 Symposium on Compiler Construction, SIGPLAN Notices 21, 7, pp. 264-275 (1986); PA1 Wall, David W., "The Mahler Experience: Using an Intermediate Language as the Machine Description", WRL Research Report 87/1 (Digital Western Research Laboratory, 1987); PA1 Wall, David W., "Register Windows vs. Register Allocation", Proceedings of the SIGPLAN '88 Conference on Programming Language Design and Implementation (June 1988); PA1 Wall, David W., "Link-Time Code Modification", WRL Research Report 89/17 (Digital Western Research Laboratory, September 1989); PA1 Wall, David W., "Systems for Late Code Modification", WRL Technical Note TN-19 (Digital Western Research Laboratory, June 1991); PA1 Wall, David W., "Systems for Late Code Modification", WRL Research Report 92/3 (Digital Western Research Laboratory, May 1992); and PA1 Zelkowitz, Marvin V., et al., "Error Checking with Pointer Variables", Proceedings of the 1976 ACM National Conference (1976).
The pertinence of the related art will also be apparent to those skilled in the art after perusal of this application.